<template>
	<view class="page-setting">
		<u-cell-group>
			<u-cell size="large" title="注销账号" label="注销不可恢复,请谨慎操作" isLink></u-cell>
			<u-cell @click="loginOut" size="large" title="退出登录" isLink></u-cell>
		</u-cell-group>
		<view style="height: 16rpx;"></view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				title: 'Hello'
			}
		},
		onLoad() {

		},
		methods: {
			// 退出登录
			loginOut() {
				uni.showModal({
					title: '提示',
					content: '确认退出登录吗？',
					success: (res) => {
						if (res.confirm) {
							uni.removeStorageSync('storage_token');
							uni.removeStorageSync('storage_userInfo');
							uni.setStorageSync('hasLogin', false);

							uni.showToast({
								title: '退出成功',
								icon: 'none',
								success: () => {
									setTimeout(() => {
										uni.reLaunch({
											url: '/pages/login/login'
										})
									}, 1500);
								}
							})
						} else if (res.cancel) {
							console.log('用户点击取消');
						}
					}
				});
			},
		}
	}
</script>

<style lang="scss" scoped>


</style>